package com.findMoneyGame.pages.game.controllers {
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.utils.Timer;

	import com.findMoneyGame.pages.game.GameLevelPage;
	import com.findMoneyGame.pages.game.controllers.Controller;
	import com.findMoneyGame.events.GameLevelEvent;
	import com.findMoneyGame.events.GameLevelPropertyChangedEvent;

	public class RewardLabelController extends Controller {
		public function RewardLabelController (gameLevelPage : GameLevelPage) {
			super(gameLevelPage);
			resetRewardLabel();
			gameLevel.data.addEventListener(GameLevelEvent.PROPERTY_CHANGED, propertyChanged);
		}

		private function propertyChanged (e : GameLevelPropertyChangedEvent) {
			if (e.property == 'reward') {
				resetRewardLabel();
			}
		}
		private function resetRewardLabel () {
			gameLevelPage.rewardLabel.text = 'Вознаграждение: ' + gameLevel.data.reward;
		}
	}
}